package com.itheima.guanbing1;

import java.util.concurrent.ArrayBlockingQueue;

public class Demo01 {

    public static void main(String[] args) {
        ArrayBlockingQueue<String> queue = new ArrayBlockingQueue<>(10);
        Cooker cooker = new Cooker(queue);
        Foodie foodie = new Foodie(queue);
        Thread t1 = new Thread(cooker);
        Thread t2 = new Thread(foodie);
        Thread t3 = new Thread(foodie);
        Thread t4 = new Thread(foodie);
        Thread t5 = new Thread(foodie);
        t1.setName("摊主");
        t2.setName("灌饼迷1");
        t3.setName("灌饼迷2");
        t4.setName("灌饼迷3");
        t5.setName("灌饼迷4");
        t1.start();
        t2.start();
        t3.start();
        t4.start();
        t5.start();

    }
}
